$(function () {
    $('#syso').bootstrapTable({
        url: '${pageContext.request.contextPath}/../../war/query',
        columns: [{
            field: 'id',
            title: '编号'
        },{
            field: 'name',
            title: '仓库名称'
        },{
            field: 'ming',
            title: '负责人'
        },{
            field: 'phone',
            title: '手机号'
        },{
            field: 'address',
            title: '联系地址'
        }, {
            field : 'xx',
            title : '操作',


            formatter:function(value,row,index){

                return "<a href='javascript:mondstu("+row.id+")'>删除</a>" ;
            }
        }],

        height: 450,
        striped:true,
        onDblClickRow: function (row, $element, field) {

            $("#myModal2").modal("show");
            $("#Sid").val(row.id);
            $("#Sname").val(row.name);
            $("#Slianxiren").val(row.ming);
            $("#Sdianhua").val(row.phone);
            $("#Sdizhi").val(row.address);


        },



    });

})

function add2() {
    var name = $("#name").val();
    var ming = $("#lianxiren").val();
    var phone = $("#dianhua").val();
    var address = $("#dizhi").val();




    $.post("${pageContext.request.contextPath}/../../war/Qtianjia",{"name":name,"ming":ming, "phone":phone,"address":address},function (data) {
        $("#syso").bootstrapTable("load",data);
    })
}
function upd() {
    var id=$("#Sid").val();
    var name = $("#Sname").val();
    var ming = $("#Slianxiren").val();
    var phone = $("#Sdianhua").val();
    var address = $("#Sdizhi").val();

    $.post("${pageContext.request.contextPath}/../../war/Qxiugai",{"id":id,"name":name,"ming":ming, "phone":phone,"address":address},function (data) {
        $("#syso").bootstrapTable("load",data);
    })
}
function Qlsit() {
    var name=$("#n").val();

    $.post("${pageContext.request.contextPath}/../../war/Qlist",{"name":name},function (data) {
        $("#syso").bootstrapTable("load",data);
    })
}
function mondstu(id) {
    var id=id;
    $.post("${pageContext.request.contextPath}/../../war/Qdel",{"id":id},function (data) {
        $("#syso").bootstrapTable("load",data);
    })
}
